<template>
    <RouterView />
    <c-modal :visible="temp.visibleModal"></c-modal>
</template>
<script setup lang="ts">
import noteMedia from '@/assets/audio/notice.mp3'
const local = useLocal()
const temp = useTemp()
temp.audio = document.createElement('audio');
temp.audio.src = noteMedia;
useLang(local.lang)
useTheme(local.theme)
let timer: any
onBeforeMount(async () => {
  timer = setInterval(() => {
    if(!local.token) return;
  }, 1000)
})
onBeforeUnmount(() => {
  clearInterval(timer)
  timer = null
})
onMounted(() => {
    // temp.showModal()
    if(!local.token) return;
    temp.getNoteData()
})
</script>
